import { createRouter, createWebHistory } from 'vue-router'


const routes = [
  {
    path: '/',
    redirect: '/sendGooders'
  },
  {
    path: '/sendGooders',
    name: 'sendGooders',
    component: () => import('../components/sendGooders.vue'),
    meta: {
      title: '待发货'
    }
  },
  {
    path: '/sendmoney',
    name: 'Sendoney',
    component: () => import('../components/sendMoney.vue'),
    meta: {
      title: '待付款'
    }
  },
  {
    path: '/rgooders',
    name: 'RGooders',
    component: () => import('../components/rGooders.vue'),
    meta: {
      title: '待收货'
    }
  }
   
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})
router.beforeEach((to, from, next) => {
  next()
  document.title = to.meta.title
}) 

 

export default router
